home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / s / enterpersonalinfo.pprx < prev    next >
Text File  |  1992-03-14  |  5KB  |  197 lines

  1. /*
  2. @BEnterPersonalInfo  @P@ICopyright Gold Disk Inc., February, 1992
  3. This Genie stores personal data for automatic retrieval and insertion.
  4. (See also InsertPersonalInfo).
  5. */
  6. address command
  7. /*
  8. call SafeEndEdit.rexx()
  9. */
  10.  
  11. cr  = '0a'x
  12. startclip   = "/*****Start Clips*****/"
  13. endclip     = "/*****End Clips*****/"
  14. startprefs  = "/*****Start Prefs*****/"
  15. endprefs    = "/*****End Prefs*****/"
  16. startsave   = "/*****StartSave*****/"
  17. endsave     = "/*****EndSave*******/"
  18. startupfile = "s:ppage.config"
  19. styletagdef = "s:styletags.dflt"
  20. paratagdef  = "s:paratags.dflt"
  21. startup     = ''
  22. clist     = 0
  23.  
  24. counter = 1
  25. num = 0
  26.  
  27.  
  28. /*
  29.  * If there is no ppage.config file, then ask for info and create
  30.  */
  31. if ~exists(startupfile) then
  32. do
  33.     startup = "/*"cr || '09'x || "Professional Page Configuration File"cr"*/"
  34.  
  35.     form    = "Name"cr"Company Name"cr"Address"cr"City"cr"State/Province"cr"Country"cr"Zip/Postal Code"cr"Phone"cr"Fax"
  36.  
  37.     form    = ppm_GetForm("Information Form", 35, form)
  38.     if form = '' then exit_msg()
  39.  
  40.     parse var form name '0a'x comp '0a'x add '0a'x city '0a'x state '0a'x country '0a'x zc '0a'x phone '0a'x fax
  41.  
  42.     prefix  = "call setclip(ppuser_"
  43.  
  44.     clips.1 = startclip
  45.     clips.2 = prefix || 'name,"'name'")'
  46.     clips.3 = prefix || 'company,"'comp'")'
  47.     clips.4 = prefix || 'address,"'add'")'
  48.     clips.5 = prefix || 'phone,"'phone'")'
  49.     clips.6 = prefix || 'fax,"'fax'")'
  50.     clips.7 = prefix || 'zipcode,"'zc'")'
  51.     clips.8 = prefix || 'city,"'city'")'
  52.     clips.9 = prefix || 'state,"'state'")'
  53.     clips.10 = prefix || 'country,"'country'")'
  54.     clips.11= endclip
  55.     clist   = 11
  56.  
  57.     call setclip(ppuser_name,name)
  58.     call setclip(ppuser_company,comp)
  59.     call setclip(ppuser_address,add)
  60.     call setclip(ppuser_phone,phone)
  61.     call setclip(ppuser_zipcode,zc)
  62.     call setclip(ppuser_city,city)
  63.     call setclip(ppuser_state,state)
  64.     call setclip(ppuser_country,country)
  65.     call setclip(ppuser_fax,fax)
  66.  
  67. end
  68. else
  69. do
  70. /*
  71.  * PPage.Config file already exists
  72.  */
  73.     if ~open(file, startupfile, "r") then
  74.         call exit_msg("DOS error. Unable to create a configuration file.")
  75.  
  76.     do while ~eof(file)
  77.  
  78.         text = strip(readln(file))
  79.         if text = '' then iterate
  80.  
  81.         if text = startclip then
  82.         /*
  83.         * Read personal info from ppage.config
  84.         */
  85.         do while ~ eof(file)
  86.  
  87.             text = readln(file)
  88.             if text = endclip then leave
  89.             
  90.         end
  91.         else
  92.             startup = startup || cr || text
  93.  
  94.     end
  95.  
  96.     call close(file)
  97.  
  98.     name = getclip(ppuser_name)
  99.     comp = getclip(ppuser_company)
  100.     add = getclip(ppuser_address)
  101.     phone = getclip(ppuser_phone)
  102.     fax = getclip(ppuser_fax)
  103.     zc = getclip(ppuser_zipcode)
  104.     city = getclip(ppuser_city)
  105.     state = getclip(ppuser_state)
  106.     country = getclip(ppuser_country)
  107.  
  108.     form = "Name:"name || cr"Company Name:"comp || cr"Address:"add || cr"City:"city || cr"State/Province:"state || cr"Country:"country || cr"Zip/Postal Code:"zc || cr"Phone:"phone || cr"Fax:"fax
  109.  
  110.     form = ppm_GetForm("Information Form", 35, form)
  111.     if form = '' then exit_msg()
  112.  
  113.     parse var form name '0a'x comp '0a'x add '0a'x city '0a'x state '0a'x country '0a'x zc '0a'x phone '0a'x fax
  114.  
  115.     prefix  = "call setclip(ppuser_"
  116.  
  117.     clips.1 = startclip
  118.     clips.2 = prefix || 'name,"'name'")'
  119.     clips.3 = prefix || 'company,"'comp'")'
  120.     clips.4 = prefix || 'address,"'add'")'
  121.     clips.5 = prefix || 'phone,"'phone'")'
  122.     clips.6 = prefix || 'fax,"'fax'")'
  123.     clips.7 = prefix || 'zipcode,"'zc'")'
  124.     clips.8 = prefix || 'city,"'city'")'
  125.     clips.9 = prefix || 'state,"'state'")'
  126.     clips.10 = prefix || 'country,"'country'")'
  127.     clips.11= endclip
  128.     clist   = 11
  129.     call setclip(ppuser_name,name)
  130.     call setclip(ppuser_company,comp)
  131.     call setclip(ppuser_address,add)
  132.     call setclip(ppuser_phone,phone)
  133.     call setclip(ppuser_fax,fax)
  134.     call setclip(ppuser_zipcode,zc)
  135.     call setclip(ppuser_city,city)
  136.     call setclip(ppuser_state,state)
  137.     call setclip(ppuser_country,country)
  138. end
  139.  
  140.  
  141. /*
  142.  * Write out info to file
  143.  */
  144. if exists(startupfile) then
  145. do
  146.     address command
  147.     'copy' startupfile startupfile".bak"
  148.     'delete' startupfile 'quiet'
  149.     address
  150. end
  151.  
  152. if ~open(file, startupfile, "w") then exit_msg("Unable to open config file")
  153. call writeln(file, startup)
  154.  
  155. do i = 1 to clist
  156.     call writeln(file, clips.i)
  157. end
  158.  
  159. call close(file)
  160. call ppm_ShowStatus("Done")
  161. exit_msg()
  162.  
  163. separate:
  164. do
  165.     arg settings
  166.  
  167.     inpar   = ''
  168.  
  169.     do i = 1 to (words(settings) - 1)
  170.  
  171.    set   = word(settings, 1)
  172.    inpar = inpar||set","
  173.    settings    = subword(settings,2)
  174.  
  175.     end
  176.  
  177.     inpar = inpar||settings
  178.  
  179.     return(inpar)
  180.  
  181. end
  182.  
  183.  
  184. exit_msg:
  185. do
  186.  
  187.     parse arg message
  188.  
  189.     if message ~= '' then
  190.    call ppm_Inform(1, message,)
  191.  
  192.     call ppm_ClearStatus()
  193.     exit
  194.  
  195. end
  196.  
  197.